module.exports = params => {
    let form = null;
    let comDriver = require('@/common/driver');
    let setTabHeight = () => {
        try {
            let winHeight = comDriver.getWinHeight();
            form.vData.tabHeight = winHeight - 62;
        }
        catch (e) {
        }
    };


    return {
        template: params => {return require('./template.ejs')(); },
        style: params => {require('./style.scss'); },
        run: params => form = params.form,
        loadDefault: async () => {
            setTabHeight();
            window.onresize = () => {
                setTabHeight();
            };
        },
        buildData: data => {
            data.theme = 'dark';
            data.showLogo = true;
            data.tabHeight = 0;
            data.menuOpen = true;
        },
        loadControls: () => {
            console.log('loadControls');
            form.param.vComputed.classObj = function() {
                console.log('classObj', this);
                return {
                    hideSidebar: this.password == 444,
                    openSidebar: true,
                    withoutAnimation: false,
                };
            }

            form.param.vMethod.btn1Click = async () => {
                console.log('btn1Clickbtn1Click');
                // console.log('btn1Click');
                // this.vData.password = 444;
                // this.showPage('form.main1');
                // console.log(this.param);
                // this.vData.password++;
                // this.vData.d.a.push({id: comDriver.createID(), name: 'fff', e: []});
            };
        },
    }
};
